Avorion Script API Documentation
Player Callbacks
Note: Callbacks have to be buffered in certain situations and won't happen immediately. When unregistering a callback during a callback, all callbacks that were buffered during the last frame may still be sent, even though they were unregistered.
callback onChatMessage(playerIndex, text, channel)
Executed whenever the player sent a chat message to the server. Only called if the chat message is valid and the player doesn't have a chat ban.
Parameters
text The text content of the chat message
channel The channel the message was sent to. 0 = All, 1 = Sector, 2 = Group, 3 = Alliance
callback onGalaxyMapMouseUp(button, mx, my, cx, cy, mapMoved)
Executed whenever on the galaxy map a mouse-up event occurs.
Parameters
mx The mouse X position
my The mouse Y position
cx The coordinates X position
cy The coordinates Y position
mapMoved True if the map was moved during the mouse pressing
callback onItemAdded(playerIndex, amount, amountBefore)
Executed whenever the number of items in a particular item slot in the player's inventory increases or a new item was added.
Parameters
amount The new amount of this item
amountBefore The amount of this item before the change
callback onItemChanged(playerIndex, amount, amountBefore)
Executed whenever the number of items in a particular item slot in the player's inventory changes.
Parameters
amount The new amount of this item
amountBefore The amount of this item before the change
callback onItemRemoved(playerIndex, amount, amountBefore)
Executed whenever the number of items in a particular item slot in the player's inventory decreases or the item was removed.
Parameters
amount The new amount of this item
amountBefore The amount of this item before the change
callback onMailCleared(playerIndex, mailIndex)
Executed whenever the player takes the contents of a mail
Parameters
mailIndex Index of the cleared mail
callback onMailDeleted(playerIndex)
Executed whenever the player deletes a mail
Parameters
callback onMailRead(playerIndex, mailIndex)
Executed whenever the player reads a mail
Parameters
mailIndex Index of the read mail
callback onMailReceived(playerIndex, index)
Executed whenever the player receives a new mail
Parameters
index Index of the received mail
callback onMoveToReconstructionSite(playerIndex)
Executed whenever a move to reconstruction site is triggered because the player was destroyed. Called even if the player is already at his reconstruction site.
Parameters
callback onRelationLevelChanged(playerIndex, factionIndex, relations)
Executed whenever the relations of the player to another faction changes.
Parameters
factionIndex Index of the other faction
relations The new relations of the player to the other faction
callback onRelationStatusChanged(playerIndex, factionIndex, status)
Executed whenever the relation status of the player to another faction changes.
Parameters
factionIndex Index of the other faction
status The new relation status of the player to the other faction
callback onResourcesChanged(playerIndex)
Executed whenever the money or resources of the player change
Parameters
callback onResourcesChanged(playerIndex)
Executed whenever the money or resources of the player change
Parameters
callback onSectorEntered(playerIndex, x, y, sectorChangeType)
Executed whenever the player enters a new sector.
Parameters
x The x coordinates of the sector entered
y The y coordinates of the sector entered
sectorChangeType The kind of sector change that is happening
callback onSectorLeft(playerIndex, x, y, sectorChangeType)
Executed whenever the player leaves his current sector.
Parameters
x The x coordinates of the sector left
y The y coordinates of the sector left
sectorChangeType The kind of sector change that is happening
callback onShipChanged(playerIndex, craftId)
Executed whenever the player changes the ship he is currently flying
Parameters
craftId The id of the new craft he is flying
callback onStartDialog(objectIndex)
Executed when a dialog is started.
Parameters
Callbacks Alliance [Client] Callbacks Alliance [Server] Callbacks Alliance [Server] Callbacks Entity Callbacks Galaxy Callbacks Player Callbacks Player [Client] Callbacks Sector Callbacks Server Callbacks
Command Entity FactionDatabase PlanGenerator Player Sector Server UsableInventoryItem
Boarding BspTree CargoBay ControlUnit DeletionTimer DirectFlightPhysics DockingPositions Durability EnergySystem Engine FighterAI Hangar InteractionText Owner Physics Plan ReadOnlyBoarding ReadOnlyBspTree ReadOnlyCargoBay ReadOnlyControlUnit ReadOnlyDeletionTimer ReadOnlyEnergySystem ReadOnlyEngine ReadOnlyFighterAI ReadOnlyHangar ReadOnlyInteractionText ReadOnlyOwner ReadOnlyPhysics ReadOnlyPlan ReadOnlyShipAI ReadOnlyShipSystem ReadOnlyTorpedoAI [Server] [Client] [Server] [Client] ReadOnlyTorpedoAI [Server] [Client] [Server] [Client] ReadOnlyTorpedoLauncher ReadOnlyTurretBases ReadOnlyVelocity ReadOnlyWeapons ReadOnlyWormHole Shield ShipAI ShipSystem SystemUpgradeLoot Thrusters Torpedo TorpedoAI TorpedoLauncher Turret TurretAI TurretBases Velocity Weapons WormHole
AllianceMember AllianceRank BlockPlan BlockPlanBlock BlockStatistics Box Color ControlUnitSeat CraftDesign Crew CrewMan CrewProfession DebugInfo dvec2 dvec3 dvec4 Entity EntityDescriptor FighterTemplate Format GameSettings HighResolutionTimer Inventory InventoryTurret ivec2 ivec3 ivec4 Language Mail Material Matrix ModManager NamedFormat PlanBspTree PlanetSpecifics PlanGenerationStage PlanPart PlanStyle PlayerId PluralForm Profiler QuadTree Random Rarity Ray ReadOnlyEntity Rect Relation SectorView Seed Sphere SystemUpgradeTemplate Timer Tooltip TooltipLine TorpedoTemplate TradingGood TurretDesign TurretDesignPart TurretTemplate UsableInventoryItem Uuid VanillaInventoryItem vec2 vec3 vec4 Version Weapon
EntityIcon EntityTooltip PlanMesh ReadOnlyIcon ReadOnlyPlanMesh ReadOnlyScriptUI ReadOnlyTooltip ScriptUI
Achievements Alliance [Client] ClientSettings CraftDesignSelectionItem Faction [Client] Galaxy [Client] GalaxyMap GameInput InputWindow InventoryReferenceSelectionItem InventorySelectionItem Keyboard LaserFX Mouse Music Planet Player [Client] PlayerWindow Sector [Client] SelectionItem SoundSource TooltipRenderer TurretDesignSelectionItem
AllianceTab ArrowLine Button [Client] [Client] Button [Client] [Client] CheckBox ComboBox CraftPortrait Frame Hud InventorySelection Label Line ListBox ListBoxEx MapArrowLine MultiLineTextBox NumbersBar Picture PlanDisplayer ProgressBar SavedDesignsSelection ScrollFrame Selection ShipWindow Slider StatisticsBar Tab TabbedWindow TextBox TextField Tree UIArbitraryHorizontalSplitter UIArbitraryVerticalSplitter UIContainer UIElement UIGridSplitter UIHorizontalLister UIHorizontalMultiSplitter UIHorizontalSplitter UIOrganizer UIRect UIRenderer UIVerticalLister UIVerticalMultiSplitter UIVerticalSplitter ValueComboBox Window
EntityTransferrer FighterController Loot ReadOnlyEntityTransferrer ReadOnlyFighterController ReadOnlyLoot ReadOnlyTurretController ReadOnlyWreckageCreator TurretController WreckageCreator
Alliance [Server] Faction [Server] Galaxy [Server] Player [Server] ReadOnlySector Sector [Server] Server
AIState AlliancePrivilege BeamShape BlockShading BlockType BoxType ChatChannel ChatMessageType ComponentType ControlAction ControlActionBit CoolingType CrewProfessionType DamageSource DamageType DeletionType Difficulty EntityArrivalType EntityType FighterOrders FighterStartError FighterType FontType ImpactParticles InventoryItemType KeyboardKey ListBoxEntryType MalusReason MaterialType MoonType MouseButton PlanetType PlayerStateType ProjectileShape RarityType RelationStatus SavedDesignType SectorChangeType SoundType StatsBonuses TransformationFeature TurretAutoFireMode WeaponAppearance WeaponCategory
This is the official documentation for the scripting API of Avorion. This documentation is automatically generated and not necessarily complete. Depending on the context in which functions exist, some documentation such as descriptions, return values or variable names or types may be missing.
Work in Progress. Documentation of Avorion Version: 1.0 r22021 59065310fc1a